Skip to content

8385409: Javap documentation says by default protected and public members are printed but package private members are also printed by default (-package behavior, not -protected)#31321

Closed
dbalek wants to merge 2 commits into
openjdk:masterfrom
dbalek:dbalek/8385409

Conversation

@dbalek
Copy link
Copy Markdown
Contributor

@dbalek dbalek commented May 29, 2026

In the current version of the JDK, there is a small inconsistency in the documentation for the javap command.

The description currently states that, when no options are used, javap prints only protected and public fields and methods.

The javap command disassembles one or more class files. The output depends on the options used.
When no options are used, the javap command prints the protected and public fields, and methods
of the classes passed to it.

This contradicts both the documented default for the -package option

-package
     Shows package/protected/public classes and members (default).

and the actual behavior of the tool: package-private members are also printed by default.

The proposed change is to update the wording to state that javap prints package-private, protected, and public fields and methods when no access-filtering option is specified.



Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change requires CSR request JDK-8385676 to be approved

Issues

  • JDK-8385409: Javap documentation says by default protected and public members are printed but package private members are also printed by default (-package behavior, not -protected) (Bug - P4)
  • JDK-8385676: Javap documentation says by default protected and public members are printed but package private members are also printed by default (-package behavior, not -protected) (CSR)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/31321/head:pull/31321
$ git checkout pull/31321

Update a local copy of the PR:
$ git checkout pull/31321
$ git pull https://git.openjdk.org/jdk.git pull/31321/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 31321

View PR using the GUI difftool:
$ git pr show -t 31321

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/31321.diff

Using Webrev

Link to Webrev Comment

…bers are printed but package private members are also printed by default (`-package` behavior, not `-protected`)
@bridgekeeper
Copy link
Copy Markdown

bridgekeeper Bot commented May 29, 2026

👋 Welcome back dbalek! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link
Copy Markdown

openjdk Bot commented May 29, 2026

@dbalek This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8385409: Javap documentation says by default protected and public members are printed but package private members are also printed by default (`-package` behavior, not `-protected`)

Reviewed-by: liach

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 33 new commits pushed to the master branch:

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@liach) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk Bot added the core-libs core-libs-dev@openjdk.org label May 29, 2026
@openjdk
Copy link
Copy Markdown

openjdk Bot commented May 29, 2026

@dbalek The following label will be automatically applied to this pull request:

  • core-libs

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk Bot added the rfr Pull request is ready for review label May 29, 2026
@mlbridge
Copy link
Copy Markdown

mlbridge Bot commented May 29, 2026

Webrevs

@AlanBateman
Copy link
Copy Markdown
Contributor

/label add compiler

@openjdk openjdk Bot added the compiler compiler-dev@openjdk.org label May 29, 2026
@openjdk
Copy link
Copy Markdown

openjdk Bot commented May 29, 2026

@AlanBateman
The compiler label was successfully added.

@jddarcy
Copy link
Copy Markdown
Member

jddarcy commented May 29, 2026

/csr needed

@jddarcy
Copy link
Copy Markdown
Member

jddarcy commented May 29, 2026

@dbalek , please run a quick CSR to cover the updating the text to match the long-standing behavior.

@openjdk openjdk Bot added the csr Pull request needs approved CSR before integration label May 29, 2026
@openjdk
Copy link
Copy Markdown

openjdk Bot commented May 29, 2026

@jddarcy has indicated that a compatibility and specification (CSR) request is needed for this pull request.

@dbalek please create a CSR request for issue JDK-8385409 with the correct fix version. This pull request cannot be integrated until the CSR request is approved.

Comment thread src/jdk.jdeps/share/man/javap.md Outdated
Co-authored-by: Chen Liang <liach@openjdk.org>
@openjdk openjdk Bot removed the csr Pull request needs approved CSR before integration label Jun 1, 2026
@openjdk openjdk Bot added the ready Pull request is ready to be integrated label Jun 1, 2026
@dbalek
Copy link
Copy Markdown
Contributor Author

dbalek commented Jun 1, 2026

/integrate

@openjdk openjdk Bot added the sponsor Pull request is ready to be sponsored label Jun 1, 2026
@openjdk
Copy link
Copy Markdown

openjdk Bot commented Jun 1, 2026

@dbalek
Your change (at version 18ac084) is now ready to be sponsored by a Committer.

@liach
Copy link
Copy Markdown
Member

liach commented Jun 1, 2026

/sponsor

@openjdk
Copy link
Copy Markdown

openjdk Bot commented Jun 1, 2026

Going to push as commit 886eb11.
Since your change was applied there have been 33 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

@openjdk openjdk Bot added the integrated Pull request has been integrated label Jun 1, 2026
@openjdk openjdk Bot closed this Jun 1, 2026
@openjdk openjdk Bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Jun 1, 2026
@openjdk
Copy link
Copy Markdown

openjdk Bot commented Jun 1, 2026

@liach @dbalek Pushed as commit 886eb11.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compiler compiler-dev@openjdk.org core-libs core-libs-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

4 participants